<template>
  <div>
    <h1>我是404-one-menu页面</h1>
    <button v-if="checkPermi(['404:yxlm:add'])">添加按钮</button>
    <button v-if="checkPermi(['404:yxlm:edit'])">编辑按钮</button>
    <button v-if="checkPermi(['404:yxlm:delete'])">删除按钮</button>
    <div>
      <select v-model="tabsPath">
        <option v-for="item in tabsPathArr" :key="item.path" :value="item">{{ item.name }}</option>
      </select>
      <button @click="openTabs">打开指定页签</button>
      <button @click="openTabs">打开指定页签</button>
    </div>
    <div>
      <button @click="modalClick">modal</button>
    </div>
    <div>
      <button @click="saveAsClick">download.saveAs</button>
    </div>
  </div>
</template>

<script>
import { checkPermi, checkRole } from "@/utils/permission";
export default {
  data() {
    return {
      downPathDocx:
        "http://8.134.222.79:3000/upload/682308c5c0a731c81a36057904a195a2.docx",
      tabsPathArr: [
        {
          name: "home首页",
          path: "/index"
        },
        {
          name: "用户管理",
          path: "/system/user"
        },

        {
          name: "角色管理",
          path: "/system/role"
        }
      ],
      tabsPath: null
    };
  },
  methods: {
    checkPermi,
    checkRole,
    // selectChange(e){
    //   console.log(e.target);
    // },
    openTabs() {
      const data = this.tabsPath;
      this.$tab.openPage(data.name, data.path);
    },
    modalClick() {
      // this.$modal.notify("默认反馈")
      // this.$modal.confirm('确认信息').then(function () {
      // }).then(() => {
      // }).catch(() => { });
      // this.$modal.loading("正在导出数据，请稍后...");
      // http://8.134.222.79:3000/upload/682308c5c0a731c81a36057904a195a2.docx
    },
    saveAsClick() {
      // this.$download.saveAs(this.downPathDocx,'lxwm.docx')
    }
  },
  mounted() {
    console.log("英雄联盟页面mounted");
  }
};
</script>

<style lang="scss" scoped>
button {
  margin-left: 1rem;
}
</style>
